Optimal. Leaf size=99 \[ \frac {2 b (b B-a C) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a-b} \sqrt {a+b}}-\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {B \tan (c+d x)}{a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.27, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.175, Rules used = {3029, 3000, 12, 2747, 3770, 2659, 205} \[ \frac {2 b (b B-a C) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 d \sqrt {a-b} \sqrt {a+b}}-\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {B \tan (c+d x)}{a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 205
Rule 2659
Rule 2747
Rule 3000
Rule 3029
Rule 3770
Rubi steps
\begin {align*} \int \frac {\left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec ^3(c+d x)}{a+b \cos (c+d x)} \, dx &=\int \frac {(B+C \cos (c+d x)) \sec ^2(c+d x)}{a+b \cos (c+d x)} \, dx\\ &=\frac {B \tan (c+d x)}{a d}+\frac {\int \frac {(-b B+a C) \sec (c+d x)}{a+b \cos (c+d x)} \, dx}{a}\\ &=\frac {B \tan (c+d x)}{a d}+\frac {(-b B+a C) \int \frac {\sec (c+d x)}{a+b \cos (c+d x)} \, dx}{a}\\ &=\frac {B \tan (c+d x)}{a d}-\frac {(b B-a C) \int \sec (c+d x) \, dx}{a^2}+\frac {(b (b B-a C)) \int \frac {1}{a+b \cos (c+d x)} \, dx}{a^2}\\ &=-\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {B \tan (c+d x)}{a d}+\frac {(2 b (b B-a C)) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{a^2 d}\\ &=\frac {2 b (b B-a C) \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{a^2 \sqrt {a-b} \sqrt {a+b} d}-\frac {(b B-a C) \tanh ^{-1}(\sin (c+d x))}{a^2 d}+\frac {B \tan (c+d x)}{a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.55, size = 129, normalized size = 1.30 \[ \frac {-\frac {2 b (b B-a C) \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}+(b B-a C) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )+\cos \left (\frac {1}{2} (c+d x)\right )\right )\right )+a B \tan (c+d x)}{a^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.66, size = 460, normalized size = 4.65 \[ \left [\frac {{\left (C a b - B b^{2}\right )} \sqrt {-a^{2} + b^{2}} \cos \left (d x + c\right ) \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) + {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (B a^{3} - B a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d \cos \left (d x + c\right )}, -\frac {2 \, {\left (C a b - B b^{2}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) \cos \left (d x + c\right ) - {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) + {\left (C a^{3} - B a^{2} b - C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (B a^{3} - B a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left (a^{4} - a^{2} b^{2}\right )} d \cos \left (d x + c\right )}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.29, size = 175, normalized size = 1.77 \[ \frac {\frac {{\left (C a - B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a^{2}} - \frac {{\left (C a - B b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a^{2}} - \frac {2 \, B \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a} + \frac {2 \, {\left (C a b - B b^{2}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} a^{2}}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.24, size = 228, normalized size = 2.30 \[ \frac {2 b^{2} \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) B}{d \,a^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 b \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right ) C}{d a \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {B}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) B b}{d \,a^{2}}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) C}{d a}-\frac {B}{a d \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) B b}{d \,a^{2}}+\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right ) C}{d a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.26, size = 675, normalized size = 6.82 \[ \frac {B\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d\,\left (a^2-b^2\right )}-\frac {C\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d\,\left (a^2-b^2\right )}+\frac {B\,a\,\mathrm {tan}\left (c+d\,x\right )}{d\,\left (a^2-b^2\right )}-\frac {B\,b^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{a^2\,d\,\left (a^2-b^2\right )}+\frac {C\,b^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{a\,d\,\left (a^2-b^2\right )}-\frac {B\,b^2\,\mathrm {tan}\left (c+d\,x\right )}{a\,d\,\left (a^2-b^2\right )}-\frac {C\,b\,\mathrm {atan}\left (\frac {\left (a^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}+2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (b^2-a^2\right )}^{3/2}-2\,b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}+3\,a^2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}-a^3\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}-a^4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a\,b^2-a^3\right )}^2}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}\,2{}\mathrm {i}}{a\,d\,\left (a^2-b^2\right )}+\frac {B\,b^2\,\mathrm {atan}\left (\frac {\left (a^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}+2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (b^2-a^2\right )}^{3/2}-2\,b^5\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}+3\,a^2\,b^3\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}-a^3\,b^2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}-a^4\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,{\left (a\,b^2-a^3\right )}^2}\right )\,\sqrt {-\left (a+b\right )\,\left (a-b\right )}\,2{}\mathrm {i}}{a^2\,d\,\left (a^2-b^2\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (B + C \cos {\left (c + d x \right )}\right ) \cos {\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}}{a + b \cos {\left (c + d x \right )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________